<?php
/**
 * @var $this \Pinenut\Action
 * @var $myProfileId string
 * @var $companionProfileId string
 * @var $listStatus int
 * @var $groups \Messenger\Groups[]
 */
?>
<ul>
	<?php foreach ($groups as $group) : ?>
		<?php foreach ($group->relations as $relation) : ?>
			<?php
			/** @var \Users\Profile $profile */
			$profile = $relation->getEntity();

			if (!method_exists($profile, 'getAvatar')) {
				continue;
			}

			if ($profile == $myProfileId) {
				continue;
			}
			?>
			<?php echo $this->action(
				'.item',
				[
					'myProfileId' => $myProfileId,
					'itemProfileId' => (string)$profile,
					'groupId' => (string)$group,
					'companionProfileId' => $companionProfileId,
				]
			); ?>
		<?php endforeach; ?>
	<?php endforeach; ?>
</ul>
